package com.gjintel.auction.business.service.serviceImpl;

import com.gjintel.auction.business.model.AuctionInfo;
import com.gjintel.auction.business.service.ISendNotifyService;
import com.gjintel.framework.constant.ActivitiMap;
import com.gjintel.framework.log.model.TSysWarningLog;
import com.gjintel.framework.log.service.impl.MessageServiceImpl;
import com.gjintel.framework.role.service.IRoleService;
import com.gjintel.framework.user.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * Created by Administrator on 2017/12/14.
 */
@Service("sendNotifyService")
public class SendNotifyServiceImpl implements ISendNotifyService {

    @Autowired
    private MessageServiceImpl messageService;

    @Autowired
    private IRoleService roleService;

    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    private static String SYS_INFO = "0";//系统信息


    //发送竞价结果通知给产权人
    @Override
    public void sendAuctionReslutNotify(AuctionInfo auctionInfo) {
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("产权人确认中标结果");
        bidderLog.setContents("您有个项目:" + auctionInfo.getAuctionName() + ",等待确定中标结果。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送竞价确认结果通知给审核人审核
    @Override
    public void sendAuctionConfirmReslutNotify(AuctionInfo auctionInfo) {
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中心确认");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "，等待确认结果。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getAuditId());
        bidderLog.setReaderName(auctionInfo.getAuditName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送竞价结果审核不通过结果给产权人
    @Override
    public void sendNoAuctionConfirmReslutNotify(AuctionInfo auctionInfo) {
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中心确认不通过");
        bidderLog.setContents("您的" + auctionInfo.getAuctionName() + "项目，确认结果审核不通过，请及时处理。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送竞价结果审核通过结果给产权人
    @Override
    public void sendYesAuctionConfirmReslutNotify(AuctionInfo auctionInfo) {
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中心确认通过");
        bidderLog.setContents("您的" + auctionInfo.getAuctionName() + "项目，确认结果审核通过。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送流标通知 给产权人和审核人
    @Override
    public void SendFlowNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("流标");
        bidderLog.setContents("您有个流标项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
        //审核人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("流标");
        bidderLog.setContents("您有个流标项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getAuditId());
        bidderLog.setReaderName(auctionInfo.getAuditName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送中标通知 给产权人,中标人和审核人
    @Override
    public void SendWinningNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中标公示");
        bidderLog.setContents("您有个中标公示项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
        //审核人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中标公示");
        bidderLog.setContents("您有个中标公示项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getAuditId());
        bidderLog.setReaderName(auctionInfo.getAuditName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
        //中标人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中标公示");
        bidderLog.setContents("您有个中标公示项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getWinnerId());
        bidderLog.setReaderName(auctionInfo.getWinnerName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }


    //提醒产权人和审核人发放中标通知书和通知中标人公示结束
    @Override
    public void remindWinningNotifyGrant(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("发放中标通知书");
        bidderLog.setContents("您有个中标公示结束项目" + auctionInfo.getAuctionName() + "，等待发放中标通知书。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
        //审核人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("发放中标通知书");
        bidderLog.setContents("您有个中标公示结束项目" + auctionInfo.getAuctionName() + "，等待发放中标通知书。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getAuditId());
        bidderLog.setReaderName(auctionInfo.getAuditName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
        //中标人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("发放中标通知书");
        bidderLog.setContents("您有个中标公示结束项目" + auctionInfo.getAuctionName() + "，等待发放中标通知书。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getWinnerId());
        bidderLog.setReaderName(auctionInfo.getWinnerName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //给产权人 中标人 发送上传合同通知
    @Override
    public void sendUploadContractNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("上传合同");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "，等待上传合同。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);

        //中标人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("上传合同");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "，等待上传合同。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getWinnerId());
        bidderLog.setReaderName(auctionInfo.getWinnerName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送上传合同锁定通知给产权人和中标人
    @Override
    public void sendContractLockNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同解锁");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "，60个工作日为合同上传，合同超时被锁定，需要解锁合同。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);

        //中标人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同解锁");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "，60个工作日为合同上传，合同超时被锁定，需要解锁合同。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getWinnerId());
        bidderLog.setReaderName(auctionInfo.getWinnerName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);

        //审核人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同解锁");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "合同超时被锁定，需要解锁合同。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getAuditId());
        bidderLog.setReaderName(auctionInfo.getAuditName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送合同审核通知给 审核人
    @Override
    public void sendContractAuditNotify(AuctionInfo auctionInfo) {
        //审核人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同审核");
        bidderLog.setContents("您有项目：" + auctionInfo.getAuctionName() + ",合同需要审核。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getAuditId());
        bidderLog.setReaderName(auctionInfo.getAuditName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送合同审核通过通知给 产权人和中标人
    @Override
    public void sendContractAuditYesNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同审核通过");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",合同审核通过。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);

        //中标人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同审核通过");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",合同审核通过。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getWinnerId());
        bidderLog.setReaderName(auctionInfo.getWinnerName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);


        //产权人 发送中标公式通知
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同公示");
        bidderLog.setContents("您有个合同公示项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);

        //中标人 发送中标公式通知
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同公示");
        bidderLog.setContents("您有个合同公示项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getWinnerId());
        bidderLog.setReaderName(auctionInfo.getWinnerName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);

        //审核人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同公示");
        bidderLog.setContents("您有个合同公示项目：" + auctionInfo.getAuctionName() + "。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getAuditId());
        bidderLog.setReaderName(auctionInfo.getAuditName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送合同审核不通过通知给 产权人和中标人
    @Override
    public void sendContractAuditNoNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同审核不通过");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "，合同审核不通过,需要重新上传合同。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);

        //中标人
        bidderLog = new TSysWarningLog();
        bidderLog.setTitle("合同审核不通过");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + "，合同审核不通过,需要重新上传合同。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getWinnerId());
        bidderLog.setReaderName(auctionInfo.getWinnerName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送项目审核通知给所有审核人
    @Override
    public void sendAllAuditorGrpNotify(AuctionInfo auctionInfo) {
        //提醒审核人，项目待审核
        //获取审核人集合
        List<User> auditList = roleService.findUserByRoleId(ActivitiMap.CENTERAUDITOR_ID);
        for (User audit : auditList) {
            TSysWarningLog warningLog = new TSysWarningLog();
            warningLog.setTitle("项目审核");
            warningLog.setContents("您有个待审核项目：" + auctionInfo.getAuctionName() + ",请及时审核。");
            warningLog.setProjectId(auctionInfo.getId());
            warningLog.setWarnType(SYS_INFO);
            warningLog.setReaderId(audit.getId());
            warningLog.setReaderName(audit.getLoginName());
            warningLog.setWarringId("");
            messageService.saveOrUpdate(warningLog);
        }
    }

    //发送项目审核通知给审核人
    @Override
    public void sendProjectAuditorNotify(AuctionInfo auctionInfo) {
        //提醒审核人，项目待审核
        TSysWarningLog warningLog = new TSysWarningLog();
        warningLog.setTitle("项目审核");
        warningLog.setContents("您有个待审核项目：" + auctionInfo.getAuctionName() + ",请及时审核。");
        warningLog.setProjectId(auctionInfo.getId());
        warningLog.setWarnType(SYS_INFO);
        warningLog.setReaderId(auctionInfo.getAuditId());
        warningLog.setReaderName(auctionInfo.getAuditName());
        warningLog.setWarringId("");
        messageService.saveOrUpdate(warningLog);
    }

    //发送超时编辑项目通知给产权人
    @Override
    public void sendEditProjectNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("项目编辑");
        bidderLog.setContents("您的" + auctionInfo.getAuctionName() + "项目超时未被审核,请重新编辑提交。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送项目审核不通过通知给产权人
    @Override
    public void sendProjectAuditNoNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("项目审核不通过");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",审核不通过，需要重新编辑提交。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送项目终止通知给产权人
    @Override
    public void sendProjectTerminateNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("项目终止");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",已被终止。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送竞拍公告通知给产权人
    @Override
    public void sendAuctionPlacardNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("竞拍");
        bidderLog.setContents("您的：" + auctionInfo.getAuctionName() + "项目竞价公告已发布");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送竞拍开始通知给产权人
    @Override
    public void sendAuctionStartNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("竞拍开始");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",竞拍已经开始。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送项目暂停审核通知业务管理员组和给产权人通知
    @Override
    public void sendProjectPauseAuditNotify(AuctionInfo auctionInfo) {
        //获取业务管理员集合 发送通知
        List<User> auditList = roleService.findUserByRoleId(ActivitiMap.BIZMANAGER_ID);
        for (User audit : auditList) {
            TSysWarningLog warningLog = new TSysWarningLog();
            warningLog.setTitle("项目暂停");
            warningLog.setContents("您有个竞拍公示质疑待审核项目：" + auctionInfo.getAuctionName() + ",请及时审核。");
            warningLog.setProjectId(auctionInfo.getId());
            warningLog.setWarnType(SYS_INFO);
            warningLog.setReaderId(audit.getId());
            warningLog.setReaderName(audit.getLoginName());
            warningLog.setWarringId("");
            messageService.saveOrUpdate(warningLog);
        }
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("项目暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",已申请竞拍质疑,等待管理员审核中。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送项目暂停审核不通过通知给产权人
    @Override
    public void sendProjectPauseNoNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("项目暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",申请竞拍公示质疑审核不通过,继续公示中。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送项目暂停审核通过通知给产权人
    @Override
    public void sendProjectPauseYesNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("项目暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",申请竞拍公示质疑审核通过,项目已被暂停,等待审核人处理质疑。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送项目质疑处理完毕继续竞拍通知给产权人
    @Override
    public void sendProjectContinueAuctionNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("项目暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",竞拍公示质疑处理完毕,重新公示中。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }


    //发送中标公示暂停审核通知业务管理员组和给产权人通知
    @Override
    public void sendWinningPublicPauseAuditNotify(AuctionInfo auctionInfo) {
        //获取业务管理员集合 发送通知
        List<User> auditList = roleService.findUserByRoleId(ActivitiMap.BIZMANAGER_ID);
        for (User audit : auditList) {
            TSysWarningLog warningLog = new TSysWarningLog();
            warningLog.setTitle("中标公示暂停");
            warningLog.setContents("您有个中标公示质疑待审核项目：" + auctionInfo.getAuctionName() + ",请及时审核。");
            warningLog.setProjectId(auctionInfo.getId());
            warningLog.setWarnType(SYS_INFO);
            warningLog.setReaderId(audit.getId());
            warningLog.setReaderName(audit.getLoginName());
            warningLog.setWarringId("");
            messageService.saveOrUpdate(warningLog);
        }
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中标公示暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",已申请中标公示质疑,等待管理员审核中。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送中标公示暂停审核不通过通知给产权人
    @Override
    public void sendWinningPublicPauseNoNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中标公示暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",申请中标公示质疑审核不通过,继续公示中。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送中标公示暂停审核通过通知给产权人
    @Override
    public void sendWinningPublicYesNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中标公示暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",申请中标公示质疑审核通过,项目已被暂停,等待审核人处理质疑。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }

    //发送中标公示质疑处理完毕继续公示通知给产权人
    @Override
    public void sendWinningContinuePublicNotify(AuctionInfo auctionInfo) {
        //产权人
        TSysWarningLog bidderLog = new TSysWarningLog();
        bidderLog.setTitle("中标公示暂停");
        bidderLog.setContents("您有个项目：" + auctionInfo.getAuctionName() + ",中标公示质疑处理完毕,重新公示中。");
        bidderLog.setProjectId(auctionInfo.getId());
        bidderLog.setWarnType(SYS_INFO);
        bidderLog.setReaderId(auctionInfo.getCreateId());
        bidderLog.setReaderName(auctionInfo.getCreateName());
        bidderLog.setWarringId("");
        messageService.saveOrUpdate(bidderLog);
    }
}